<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.prime.com.tr/ui">
    <h:head>
        <title> Giáo Vụ</title>
    </h:head>
    <f:view>
    <h:form id ="akdfjds" prependId="false" >
    <p:dataTable var="mh" value="#{giaovienController.getAll()}" id="list" selectionMode="single"  paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15" >
   
        <f:facet name="header"  >
            <h:commandButton image="/resources/images/icon/plus.png"  action="#{giaovienController.actionNew()}" label="Tạo Môn Học"/>
        </f:facet>

        <p:column headerText=" Mã Giáo Viên" style="width:150px">      
                    <h:outputText value="#{mh.magv}" />
        </p:column>

        <p:column headerText="Tên Giáo Viên" style="width:150px">
                    <h:outputText value="#{mh.tengv}" />
        </p:column>
       
        <p:column headerText="Ngày Sinh" style="width:150px">            
                    <h:outputText value="#{mh.ngaysinh}" />
        </p:column>
        <p:column headerText="Ngày Sinh" style="width:150px">            
                    <h:outputText value="#{mh.diachi}" />
        </p:column>
        <p:column headerText="Ngày Sinh" style="width:150px">            
                    <h:outputText value="#{mh.email}" />
        </p:column>
        <p:column headerText="Action">
            <h:commandLink value="Sửa" action="#{giaovienController.actionEdit}"  style ="padding-left: 20px; padding-right: 30px" >
                         <f:param name="id_giaovien" value="#{mh.magv}" />  
                </h:commandLink>
            <p:commandButton value ="Xóa" action="#{giaovienController.delete(mh)}" ajax="true" update="akdfjds" />
        </p:column>
          
    </p:dataTable>
    </h:form>
   </f:view>
</html>

